﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace BAL.EstRec.HQConsolidacion 
{
    public class ConsolidacionCollection : ObservableCollection<Consolidacion>
    {
        public ConsolidacionCollection(long unidVersion)
        {
            if (unidVersion != 0)
            {
                try
                {
                    Consolidacion.GetConsolidacion(unidVersion).ToList().ForEach(
                        d =>
                        {
                            this.Add(d);
                        }
                    );
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }

        public void load(ObservableCollection<Consolidacion> consolidacionColl)
        {
            consolidacionColl.ToList().ForEach(
                        d =>
                        {
                            this.Add(d);
                        }
                    );
        }
    }
}
